<div id="RightCol">
<?
if($strStyleSheet == TRUE)
	echo "<table class='Normal' border='0' align='left' width='600'>";
?>
	<tr>
		<td align='left' colspan='5'>
    		<h3>Order Status Report <?php echo ( date("H:i l, d F Y") );?></h3>
    	</td>
    </tr>

	<?php
	$intPrevOrderYear = 0;
	$strOrderStatus = "";
	include (MODULE . "/action/qrySelectOrder_Status_Totals_Full");
	//echo $strSQL;
	// If Category appears again in the loop create / populate the submenu
	// If Category and Sub-category are the same don't create sub-menus
	do {
		$intOrderYear = $myrow["OrderYear"];   
		$strOrderStatus = $myrow["OrderStatus"];
		?>
		<div class="Report">
		<tr>
			<td colspan='5' align='left'>	
			<? 	
			
			if ($intOrderYear != $intPrevOrderYear) { 
					//echo "Cancelled = ".$intCancelledTotal;
					echo "<h1>".$myrow["OrderYear"]."</h1>";

					
			}
				
			if ($strOrderStatus != $strPrevOrderStatus) {
				echo "<b>".$myrow["OrderStatus"]."</b>";
			} 
			
			
			?>
			</td>
		</tr>
		<tr>
			<td>
				<?php echo ReformatFromMySQLDate($myrow["OrderDate"])?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			</td>
			<td>
				<?php echo "<a href='".ScreenURL("DisplayOrderHeader",array('intOrderHeaderID'=>$myrow["OrderHeaderID"]) )."' target='_blank'>".$myrow["OrderHeaderID"]."</a>"?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				
			</td>
			<td>				
				<?php echo $myrow["Product"]?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			</td>
			<td>
				<?php
					if($myrow[SalesChannel] != 1)
						echo "<a href='https://sellercentral-europe.amazon.com/gp/orders-v2/details?ie=UTF8&orderID=".$myrow["OtherInfo"]."' target='_blank'>".$myrow["OtherInfo"]."</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
				?>
			</td>		
			<td>	
				<?php echo CURRENCY.number_format($myrow["UnitPrice"]);?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			</td>
			<td>
				<?php echo "<a href='".ScreenURL("DisplayCustomer",array('intCustomerID'=>$myrow["Customer"]) )."' target='_blank'>".$myrow["ShipName"]."</a>"?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			</td>
		</tr>

		</div>
		<?php
		$intPrevOrderYear = $intOrderYear;	 
		$strPrevOrderStatus	= $strOrderStatus;
	 } while ($myrow = mysql_fetch_array($result));
	 
	if($strStyleSheet == TRUE){
   		echo "</table>";
	}
	?>

</div>
